//
//  toupiaotopCollectionViewCell.m
//  hainingOASystem
//
//  Created by michael on 2017/12/11.
//  Copyright © 2017年 czd. All rights reserved.
//

#import "toupiaotopCollectionViewCell.h"

@implementation toupiaotopCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
    _label1 = [[UILabel alloc]init];
    _label1.frame = CGRectZero;
        _label1.numberOfLines = 0;

      [_label1 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label1];
    
       _label2 = [[UILabel alloc]init];
    _label2.frame = CGRectZero;
    _label2.numberOfLines = 0;
      [_label2 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label2];
          _label3 = [[UILabel alloc]init];
    _label3.frame = CGRectZero;
    _label3.numberOfLines = 0;
      [_label3 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label3];
        _label4 = [[UILabel alloc]init];
    _label4.frame = CGRectZero;
    _label4.numberOfLines = 0;
      [_label4 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label4];
       
               _label5 = [[UILabel alloc]init];
    _label5.frame = CGRectZero;
    _label5.numberOfLines = 0;
      [_label5 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label5];
       
               _label6 = [[UILabel alloc]init];
    _label6.frame = CGRectZero;
    _label6.numberOfLines = 0;
      [_label6 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label6];
_image = [[UIImageView alloc]init];
_image.frame = CGRectZero;
       [self.contentView addSubview:_image];

}
return self;
}
- (void)layoutSubviews{
[super layoutSubviews];
NSString *url = [NSString stringWithFormat:@"%@%@",kip,_dic[@"imgUrl"]];
[self.image sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"加载"]];
_image.frame = CGRectMake(0
, 0 , KScreenWidth, 150);
_label1.frame = CGRectMake(10, _image.bottom+10, 80, 30);
_label1.text = @"投票时间:";
_label2.frame = CGRectMake(_label1.right, _image.bottom+10, KScreenWidth-20-_label1.width, 30);
//0 96 246
_label2.textColor = [UIColor colorWithRed:0/255.0 green:96/255.0 blue:246/255.0 alpha:1];
_label2.text= [NSString stringWithFormat:@"%@ —— %@",_dic[@"startDate"],_dic[@"endDate"]];
NSString *string4 = _dic[@"title"];
        CGFloat titleSize = [OAToolBox sizebyText:string4 font:13 minsWidth:100];
_label3.frame = CGRectMake(10, _label1.bottom, 80, 15);
_label3.text = @"投票说明:";
//_label3.backgroundColor = [UIColor redColor];

        _label4.text =string4;
_label4.frame = CGRectMake(_label3.right, _label1.bottom, KScreenWidth-100, titleSize);
//_label4.backgroundColor = [UIColor greenColor];
_label4.textColor = [UIColor colorWithRed:0/255.0 green:96/255.0 blue:246/255.0 alpha:1];
NSString *string6 = _dic[@"content"];
_label6.text =string6;
        CGFloat titleSize6 = [OAToolBox sizebyText:string6 font:13 minsWidth:100];
_label5.frame = CGRectMake(10, _label4.bottom, 80, 20);
_label5.text = @"活动介绍:";
//_label5.backgroundColor = [UIColor yellowColor];

//        _label6.backgroundColor = [UIColor purpleColor];
        _label6.text =string6;
_label6.frame = CGRectMake(_label3.right, _label4.bottom, KScreenWidth-100, titleSize6);
_label6.textColor = [UIColor colorWithRed:0/255.0 green:96/255.0 blue:246/255.0 alpha:1];



}
@end
